﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Repository.Models
{
    /// <summary>
    /// 每日计划食谱
    /// </summary>
    public class PlanDayRecipes : BusinessFullEntityBase<Guid>
    {

        /// <summary>
        /// 每周计划食谱id
        /// </summary>
        public Guid PlanWeekRecipesId { get; set; }

        public PlanWeekRecipes PlanWeekRecipes { get; set; }

        /// <summary>
        /// 日期（：2023-01-01）
        /// </summary>
        public string Date { get; set; }

        /// <summary>
        /// 日期（：星期一）
        /// </summary>
        public string DateStr { get; set; }


        /// <summary>
        /// 就餐人数
        /// </summary>
        public int Number { get; set; } 

        public List<PlanDayRecipesDetail> PlanDayRecipesDetails { get; set; }


        public override void ConfigureEntity(ModelBuilder builder)
        {
            builder.Entity<PlanDayRecipes>(entity =>
            {
                entity.HasOne(c => c.PlanWeekRecipes).WithMany(c => c.PlanRecipesList).HasForeignKey(c => c.PlanWeekRecipesId); 
            });
        }

    }
}
